{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "e776c2b3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "99 bottles of beer on the wall.\n",
      "99 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "98 bottles of beer on the wall.\n",
      "98 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "97 bottles of beer on the wall.\n",
      "97 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "96 bottles of beer on the wall.\n",
      "96 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "95 bottles of beer on the wall.\n",
      "95 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "94 bottles of beer on the wall.\n",
      "94 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "93 bottles of beer on the wall.\n",
      "93 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "92 bottles of beer on the wall.\n",
      "92 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "91 bottles of beer on the wall.\n",
      "91 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "90 bottles of beer on the wall.\n",
      "90 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "89 bottles of beer on the wall.\n",
      "89 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "88 bottles of beer on the wall.\n",
      "88 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "87 bottles of beer on the wall.\n",
      "87 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "86 bottles of beer on the wall.\n",
      "86 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "85 bottles of beer on the wall.\n",
      "85 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "84 bottles of beer on the wall.\n",
      "84 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "83 bottles of beer on the wall.\n",
      "83 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "82 bottles of beer on the wall.\n",
      "82 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "81 bottles of beer on the wall.\n",
      "81 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "80 bottles of beer on the wall.\n",
      "80 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "79 bottles of beer on the wall.\n",
      "79 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "78 bottles of beer on the wall.\n",
      "78 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "77 bottles of beer on the wall.\n",
      "77 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "76 bottles of beer on the wall.\n",
      "76 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "75 bottles of beer on the wall.\n",
      "75 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "74 bottles of beer on the wall.\n",
      "74 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "73 bottles of beer on the wall.\n",
      "73 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "72 bottles of beer on the wall.\n",
      "72 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "71 bottles of beer on the wall.\n",
      "71 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "70 bottles of beer on the wall.\n",
      "70 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "69 bottles of beer on the wall.\n",
      "69 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "68 bottles of beer on the wall.\n",
      "68 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "67 bottles of beer on the wall.\n",
      "67 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "66 bottles of beer on the wall.\n",
      "66 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "65 bottles of beer on the wall.\n",
      "65 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "64 bottles of beer on the wall.\n",
      "64 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "63 bottles of beer on the wall.\n",
      "63 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "62 bottles of beer on the wall.\n",
      "62 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "61 bottles of beer on the wall.\n",
      "61 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "60 bottles of beer on the wall.\n",
      "60 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "59 bottles of beer on the wall.\n",
      "59 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "58 bottles of beer on the wall.\n",
      "58 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "57 bottles of beer on the wall.\n",
      "57 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "56 bottles of beer on the wall.\n",
      "56 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "55 bottles of beer on the wall.\n",
      "55 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "54 bottles of beer on the wall.\n",
      "54 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "53 bottles of beer on the wall.\n",
      "53 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "52 bottles of beer on the wall.\n",
      "52 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "51 bottles of beer on the wall.\n",
      "51 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "50 bottles of beer on the wall.\n",
      "50 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "49 bottles of beer on the wall.\n",
      "49 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "48 bottles of beer on the wall.\n",
      "48 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "47 bottles of beer on the wall.\n",
      "47 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "46 bottles of beer on the wall.\n",
      "46 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "45 bottles of beer on the wall.\n",
      "45 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "44 bottles of beer on the wall.\n",
      "44 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "43 bottles of beer on the wall.\n",
      "43 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "42 bottles of beer on the wall.\n",
      "42 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "41 bottles of beer on the wall.\n",
      "41 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "40 bottles of beer on the wall.\n",
      "40 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "39 bottles of beer on the wall.\n",
      "39 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "38 bottles of beer on the wall.\n",
      "38 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "37 bottles of beer on the wall.\n",
      "37 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "36 bottles of beer on the wall.\n",
      "36 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "35 bottles of beer on the wall.\n",
      "35 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "34 bottles of beer on the wall.\n",
      "34 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "33 bottles of beer on the wall.\n",
      "33 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "32 bottles of beer on the wall.\n",
      "32 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "31 bottles of beer on the wall.\n",
      "31 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "30 bottles of beer on the wall.\n",
      "30 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "29 bottles of beer on the wall.\n",
      "29 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "28 bottles of beer on the wall.\n",
      "28 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "27 bottles of beer on the wall.\n",
      "27 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "26 bottles of beer on the wall.\n",
      "26 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "25 bottles of beer on the wall.\n",
      "25 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "24 bottles of beer on the wall.\n",
      "24 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "23 bottles of beer on the wall.\n",
      "23 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "22 bottles of beer on the wall.\n",
      "22 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "21 bottles of beer on the wall.\n",
      "21 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "20 bottles of beer on the wall.\n",
      "20 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "19 bottles of beer on the wall.\n",
      "19 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "18 bottles of beer on the wall.\n",
      "18 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "17 bottles of beer on the wall.\n",
      "17 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "16 bottles of beer on the wall.\n",
      "16 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "15 bottles of beer on the wall.\n",
      "15 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "14 bottles of beer on the wall.\n",
      "14 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "13 bottles of beer on the wall.\n",
      "13 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "12 bottles of beer on the wall.\n",
      "12 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "11 bottles of beer on the wall.\n",
      "11 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "10 bottles of beer on the wall.\n",
      "10 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "9 bottles of beer on the wall.\n",
      "9 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "8 bottles of beer on the wall.\n",
      "8 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "7 bottles of beer on the wall.\n",
      "7 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "6 bottles of beer on the wall.\n",
      "6 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "5 bottles of beer on the wall.\n",
      "5 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "4 bottles of beer on the wall.\n",
      "4 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "3 bottles of beer on the wall.\n",
      "3 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "\n",
      "2 bottles of beer on the wall.\n",
      "2 bottles of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "1 bottle of beer on the wall\n",
      "\n",
      "1 bottle of beer on the wall.\n",
      "1 bottle of beer\n",
      "Take one down.\n",
      "Pass it around\n",
      "没有足够的bottles在wall上了\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# Author:luoyu\n",
    "# 时间：0923-week4\n",
    "\n",
    "word = \"bottles\"\n",
    "for beer_num in range(99,0,-1):\n",
    "    print(beer_num,word,\"of beer on the wall.\")\n",
    "    print(beer_num,word,\"of beer\")\n",
    "    print(\"Take one down.\")\n",
    "    print(\"Pass it around\")\n",
    "    # 1. 拿不走了\n",
    "    if beer_num == 1:\n",
    "        print(\"没有足够的bottles在wall上了\")\n",
    "    # 2. 还有足够的啤酒\n",
    "    else:\n",
    "        new_num = beer_num - 1\n",
    "        if new_num == 1:\n",
    "            word = \"bottle\"\n",
    "            print(new_num,word,\"of beer on the wall\")\n",
    "    # 空行\n",
    "    print()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4f23ac41",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
